<?php

/**
 * Description of G_Imagick
 *
 * @author Monk <eoe2005@gmail.com>
 */
if (class_exists('Imagick') === false)
{
    trigger_error('系统不支持Imagick');
    die();
}

class G_Imagick extends GC_Image
{

    public function clip($src, $w, $h, $outfile = null)
    {
        
    }

    public function resize($src, $w, $h, $outfile = null)
    {
        $im = new Imagick($src);
        $im->resizeimage($w, $h, Imagick::FILTER_LANCZOS, 0.9,true);
        if($outfile){
            $im->setImageFormat('jpg');
            return $im->writeimage($outfile);
        }else{
            header('Content-type: jpg');
            echo $im->getImagesBlob();
        }
    }

    public function scale($src, $w, $h, $outfile = null)
    {
        
    }

    public function showCode($code, $w, $h)
    {
        
    }

    public function watermark($src, $waterfile, $position = G_IMAGE_WATERMARK_BOTTOM_RIGHT, $outfile = null)
    {
        
    }

}
